<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>请假列表 - 企业信息管理系统</title>
    <meta th:replace="~{head/head_include ::  title}"/>
</head>
<body>
<meta th:replace="~{head/head_include ::  header}"/>
<!-- 网页的主体部分 -->
<div class="container">
    <div class="row">
        <div class="col-md-11 col-sm-offset-1">
            <h2 class="sub-header">请假列表</h2>
            <form th:action="@{/head/users/leaveList}" method="post" class="form-inline">
                <input type="hidden" name="dynastyId" value="${requestScope.dynastyId }">

                <!--<label for="status">状态:</label>
                <select name="status" class="form-control mr-sm-2">
                    <option value="">请选择</option>
                    <c:forEach items="${pojo.enumsMap }" var="me" varStatus="stat">
                        <c:if test="${fn:startsWith(me.key,'STATUS')}">
                            &lt;!&ndash; 拆分,按照-拆分,取最后一个 &ndash;&gt;
                            <c:set value="${fn:split(me.key, '-')}" var="keys"/>
                            <option value="${keys[1] }" ${requestScope.status == keys[1] ? 'selected' : '' }>${me.value}</option>
                        </c:if>
                    </c:forEach>
                </select>-->
                <!--<label for="pubTime">发布时间:</label>
                <input type="text" name="st" value="" readonly="true" class="form-control mr-sm-2" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                &ndash;&gt;
                <input type="text" name="ed" value="" readonly="true" class="form-control mr-sm-2" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                <input type="submit" class="btn btn-primary" value="搜索">-->
                <a th:href="@{/head/users/leaveInsert}" target="_blank" class="btn btn-primary ml-2">添加</a>
            </form>
        </div>
        <div class="col-md-11 col-sm-offset-1">
            <div class="table-responsive mt-2">
                <table class="table table-striped table-hover">
                    <thead>
                    <tr>
                        <th>单号</th>
                        <th>名称</th>
                        <th>开始时间</th>
                        <th>结束时间</th>
                        <th>类型</th>
                        <th>状态</th>
                        <th>审核人</th>
                        <th>审核时间</th>
                        <th>更新时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <th:block th:each="oneTemp : ${dataList }">
                        <tr>
                            <td th:title="${oneTemp.leaveNo}" th:text="${oneTemp.leaveNo.length() > 5 ? oneTemp.leaveNo.substring(0,5) : oneTemp.leaveNo}"></td>
                            <td class="text-l" th:title="${oneTemp.name}">
                                <a  title="请假查看"
                                   th:href="@{/head/users/leaveUpdate('entity.id'=${oneTemp.id })}"
                                   th:text="${oneTemp.name.length() > 5 ? oneTemp.name.substring(0,5) : oneTemp.name}" target="_blank">
                                </a>
                            </td>
                            <td th:text="${#dates.format(oneTemp.leaveStartDate,'yyyy-MM-dd')}"></td>
                            <td th:text="${#dates.format(oneTemp.leaveEndDate,'yyyy-MM-dd')}"></td>
                            <td class="td-status">
                                <span class="label label-success radius">
                                    <span class="label label-success radius" th:text="${oneTemp?.leaveTypeStr}">
                                    </span>
                                </span>
                            </td>
                            <td class="td-status">
                                <span class="label label-success radius">
                                    <span class="label label-success radius" th:text="${oneTemp?.statusStr}">
                                    </span>
                                </span>
                            </td>
                            <td class="td-status">
                                <span class="label label-success radius">
                                    <span class="label label-success radius" th:text="${oneTemp?.auditObj?.name}">
                                    </span>
                                </span>
                            </td>
                            <td th:text="${#dates.format(oneTemp.auditTime,'yyyy-MM-dd HH:mm:ss')}"></td>
                            <td th:text="${#dates.format(oneTemp.updateTime,'yyyy-MM-dd HH:mm:ss')}"></td>
                            <td>
                                <th:block th:if="${oneTemp.status == '0'}">
                                    <a data-title="请假更新" title="请假更新" target="_blank"
                                       th:href="@{/head/users/leaveUpdate(operType='updateInfo','entity.id'=${oneTemp.id })}"
                                    >更新</a>
                                </th:block>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="col-md-11 col-sm-offset-1">
            <form id="pageForm" th:action="@{/head/users/leaveList}"
                  method="post" class="form-inline col-md-11 col-sm-offset-1">
                <!-- 设置一些参数 -->
                <input type="hidden" name="st" value="${requestScope.st }">
                <input type="hidden" name="ed" value="${requestScope.ed }">

                <input type="hidden" name="dynastyId" value="${requestScope.dynastyId }">

                <nav aria-label="Page navigation example">
                    <ul class="pagination justify-content-end">
                        <li class="page-item">
                            <a href="#" class="page-link"
                               th:onclick="return pageFormSubmit('pageForm','current','1','size','[[${pageInfoUtil?.size}]]')"
                            >
                                <span>首页</span>
                            </a>
                        </li>
                        <li class="page-item">
                            <a href="#" class="page-link"
                               th:onclick="return pageFormSubmit('pageForm','current','[[${pageInfoUtil?.current - 1}]]','size','[[${pageInfoUtil?.size}]]')"
                            >
                                <span>上一页</span>
                            </a>
                        </li>
                        <li class="page-item">
                            <a href="#" class="page-link"
                               th:onclick="return pageFormSubmit('pageForm','current','[[${pageInfoUtil?.total}]]','size','[[${pageInfoUtil?.size}]]')"
                            >
                                <span>下一页</span>
                            </a>
                        </li>
                        <li class="page-item">
                            <a href="#" class="page-link"
                               onclick="return pageFormSubmit('pageForm', 'currentPage', '${pageInfoUtil.totalPage}', 'pageSize','${pageInfoUtil.pageSize}')"
                            >
                                <span>尾页</span>
                            </a>
                        </li>
                        <li class="page-item">
                            共<span th:text="${pageInfoUtil?.pages}"></span>页，
                            共<span th:text="${pageInfoUtil?.total }"></span>条
                        </li>
                        <li class="page-item">
                            第<input type="text" id="current" name="current"
                                     th:value="${pageInfoUtil?.current}" class="form-control"
                                     size="5" maxlength="5"/>页
                        </li>
                        <li class="page-item">
                            <input type="text" id="size" name="size"
                                   th:value="${pageInfoUtil?.size}" class="form-control" size="5" maxlength="5"/>
                        </li>
                        <li class="page-item"><input type="submit" value="GO" class="form-control btn btn-primary"/></li>
                    </ul>
                </nav>
            </form>
        </div>
    </div>
</div>
<meta th:replace="~{head/head_include ::  footer}"/>
</body>
</html>